//
//  HomeRemovelocationView.m
//  CheekiOS
//
//  Created by mac on 2017/7/31.
//  Copyright © 2017年 mac. All rights reserved.
//

#import "HomeRemovelocationView.h"

@interface HomeRemovelocationView ()

@property (nonatomic, strong) UIImageView *loctionImageView;
@property (nonatomic, strong) UIButton *openloctionButton;
@property (nonatomic, strong) UILabel *openLabel;
@end

@implementation HomeRemovelocationView

- (instancetype)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    
    if (self) {
        
        [self setUpWaves];
    }
    
    return self;
}
- (void)setUpWaves{
    
    CGFloat TopsegmentFloat ;
    
    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad){
        NSLog(@"ipad");
        TopsegmentFloat =400*SCREEN_WIDTH_RATIO47;

    }else{
        TopsegmentFloat =450*SCREEN_WIDTH_RATIO47;
        NSLog(@"iphone or ipod");
    }
    
    self.loctionImageView = [[UIImageView alloc] initWithFrame:CGRectMake(5*SCREEN_WIDTH_RATIO47, 64+5*SCREEN_WIDTH_RATIO47, KScreenWidth-10*SCREEN_WIDTH_RATIO47, TopsegmentFloat)];
    self.loctionImageView.image = [UIImage imageNamed:@"home_card_empt_ai"];
    self.loctionImageView.userInteractionEnabled = YES;
    [self addSubview:self.loctionImageView];
    
    
    self.openLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, TopsegmentFloat-55, KScreenWidth, 30)];
    self.openLabel.font = FontBold(17);
    self.openLabel.textAlignment = NSTextAlignmentCenter;
    self.openLabel.text = @"点击重新开启你的浪漫之约";
    self.openLabel.textColor = ColorI(0x2e353f);
    [self.loctionImageView addSubview:self.openLabel];
    
    self.openloctionButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.openloctionButton.frame = CGRectMake(KScreenWidth/2-30, self.openLabel.top-60-18, 60, 60);
    [self.openloctionButton addTarget:self action:@selector(RemovelocationButton) forControlEvents:UIControlEventTouchUpInside];
    [self.openloctionButton setBackgroundImage:[UIImage imageNamed:@"home_card_empt_button"] forState:UIControlStateNormal];
    [self.loctionImageView addSubview:self.openloctionButton];
}

-(void)RemovelocationButton{
    
    if ([self.delegate respondsToSelector:@selector(RemovelocationButton)]) {
        [self.delegate RemovelocationButton];
    }

}



@end
